Xbasic

SQL::QueryGenerateNativeSyntax Method

Syntax

SQL_Statement as C = GenerateNativeSyntax([SQLConnection as [SQL::Connection | C])

Arguments

SQLConnectionSQL::ConnectionCharacter

A connection string or SQL::Connection object with a defined .ConnectionString property.

Returns

SQL_StatementCharacter

The native SQL equivalent of a Portable SQL expression.

Description

Generate a native SQL statement using the selected syntax associated with the current or passed connection.

Discussion

The .GenerateNativeSyntax() method returns the native SQL version of the Portable SQL stored in the SQL::Query.SQLStatement property.

Example

dim qry as SQL::Query
dim conn as SQL::Connection
dim connString as C
connString = "{A5API='Access', FileName='c:\program files\a5v7\mdbfiles\alphasports.mdb'}"
? conn.open(connString)
= .T.
? qry.parse("Select * from Customer WHERE substring(lastname,1,1) = 'a'")
= .T.
? qry.GenerateNativeSyntax(connString)
= "SELECT * FROM CustomerWHERE (Mid(lastname, 1, 1) = 'a')"

See Also